package com.itheima.reggie.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class Employee implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long id;

    private String username;

    private String name;//员工姓名

    private String password;

    private String phone;

    private String sex;

    private String idNumber;//身份证

    private Integer status;


    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;


    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    /**
     * 实现公共字段填充
     * 在实体类的属性上加入@TableField,指定自动填充的策略
     * 按框架要求编写元对象处理器，在此类中统一为公共字段赋值，此类需是实现MetaObjectHandler接口
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;

}
